package com.cszjzx.member.dao;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import com.cszjzx.member.po.TempleMember;
import com.sun.javafx.collections.MappingChange.Map;

public interface TempleMemberDAO {
	public void add(TempleMember templeMember) throws SQLException;
	public void addList(List<TempleMember> templeMembers);
	/**
	 * 
	 * @param templeMember
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public void update(List<TempleMember> templeMembers) throws SQLException, IOException, ClassNotFoundException;
	
	public void  update(TempleMember templeMember) throws SQLException;
	/**
	 * 根据操作审核状态查询零时数据相关信息
	 * @param checkcondition 
	 * 0查询所有的
	 * 1：待审核
	 * 2：审核通过
	 * 3：审核不通过
	 * @return
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public List<TempleMember> findByCheckCondition(int checkcondition) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 管理员查询操作审核
	 * @param checkcondition
	 * @return
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 * @throws IOException
	 */
	public List<TempleMember> findByCheckConditionAndMasterid(int masterid,int checkcondition) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 根据身份证号找操作
	 * @param idcard
	 * @return
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 * @throws IOException
	 */
	public TempleMember findByIdcard(String idcard) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 根绝序号找操作
	 * @param id
	 * @return
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public TempleMember findById(int id) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 查看系部管理员未读审核信息
	 * @param masterid
	 * @param checkcondition
	 * @return
	 * @throws ClassNotFoundException
	 * @throws SQLException
	 * @throws IOException
	 */
	public List<TempleMember> findIsReadByCheckConditionAndMasterid(int masterid, int checkcondition) throws ClassNotFoundException, SQLException, IOException;
	
	/**
	 * 在阶段浏览中查看处于当前阶段的这个班级的团员有多少是处于被审核状态中的
	 * @param process
	 * @param major
	 * @return 符合这个情况的团员的身份证
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public List<String> findIdcarsByProcessAndMajor(int process, String major) throws ClassNotFoundException, SQLException, IOException;

	/**
	 * 在信息添加时，根据身份证检查该团员是否处在被审核状态
	 * @param idcard
	 * @return true:此团员不在审核状态，可以添加；false:此团员在审核状态，不可添加
	 * @throws IOException 
	 * @throws SQLException 
	 * @throws ClassNotFoundException 
	 */
	public boolean findIdcardByIdcard(String idcard) throws ClassNotFoundException, SQLException, IOException;
	/**
	 * 将该管理员审核通过的信息设置为已读
	 * @param masterid
	 * @throws SQLException
	 */
	public void setIsReadNullByMasterid(int masterid) throws SQLException;
	
	/**
	 * 重新提交后，根据id删除templeMember中的一条审核记录
	 * @param id
	 * @throws SQLException 
	 */
	public void deleteById(int id) throws SQLException;
}
